/*
 * Clase madre de todas las criaturas
 *
 * This is part of the game The Rooms
 * Copyright (C) 2010  Elvio Sarquis
 *
 * Get the GNU GPL v3 in http://www.gnu.org/licenses/
 */

package rooms;

/**
 *
 * @author dask
 */
public class Character {

    /*
     * Declaraciones
     */
    private int x=0, y=0;
    private int id, color;
    private char simbol;
    private int hp, mana, maxhp, maxmana;
    private int bstr, bdex, bwis;
    private boolean alive;
    private String name, race;

    /*
     * Constructores
     */
    public Character(int x1, int y1, char simbolo, String namea, String racea, int colora, int hps, int manas, int stre, int dext, int wisd){

        x = x1;
        y = y1;
        simbol = simbolo;
        color= colora;
        name = namea;
        race = racea;
        alive = true;
        maxhp = hp = hps;
        maxmana = mana = manas;
        bstr = stre;
        bdex = dext;
        bwis = wisd;

    }

    public Character(int x1, int y1){
        
        this(x1,y1,'g',"Grunt","Goblin",6,2,1,4,3,2);
    }

    /*
     * Funciones
     */

    public void changeHP(int HPVar){
        hp = hp + HPVar;
        if(hp>maxhp)
            hp = maxhp;
        if(hp<=0)
            alive = false;
    }

    public void changeMana(int ManaVar){
        mana = mana + ManaVar;
        if(mana>maxmana)
            mana = maxmana;
        if(mana<0)
            mana = 0;
    }

    /*
     * De aca, solo Gets y Sets
     */

    public int getX(){
        return x;
    }

    public int getY(){
        return y;
    }

    public int getId(){
        return id;
    }

    public char getSimbol(){
        return simbol;
    }

    public int getColor(){
        return color;
    }

    public int getHP(){
        return hp;
    }
    
    public int getMaxHP(){
        return maxhp;
    }
    
    public int getMana(){
        return mana;
    }
    
    public int getMaxMana(){
        return maxmana;
    }

    public String getName(){
        return name;
    }

    public String getRace(){
        return race;
    }

    public boolean getAlive(){
        return alive;
    }

    public int getBaseStr(){
        return bstr;
    }

    public int getBaseDex(){
        return bdex;
    }

    public int getBaseWis(){
        return bwis;
    }

    public void setX(int newval){
        x = newval;
    }

    public void setY(int newval){
        y = newval;
    }

    public void setId(int newval){
        id = newval;
    }
    
    public void setSibol(char simbolo){
        simbol = simbolo;
    }

    public void setColor(int newcolor){
        color = newcolor;
    }

    public void setHP(int newHP){
        hp = newHP;
    }

    public void setMaxHP(int newMaxHP){
        maxhp = newMaxHP;
    }
}